#pragma once
#include "GLHeaders.h"
#include<fstream>
#include<string.h>
#include <sstream>
struct VertexData
{
    QVector3D position;
    QVector2D texCoord;
};
class CRead
{
public:
    CRead(GLFuncName *func);
    ~CRead();
    void draw(QOpenGLShaderProgram &program, const QMatrix4x4 &model, const QMatrix4x4 &view, const QMatrix4x4 &project);
private:
    void initBuffer();
    void initShader();
    void initTexture();
    void ReadPoint();
    void ReadFacet();
private:
    GLFuncName *m_func;
    QOpenGLBuffer m_arrayBuf;
    QOpenGLBuffer m_indexBuf;
    QOpenGLShader m_vertexShader;
    QOpenGLShader m_fragmentShader;
    QOpenGLTexture m_texture;
    VertexData vertices[19231];
    GLushort indices[38388*3];
    quint32 m_vao;

public:
    std::string name=":/assets/1.txt";
    int m_indexCount = 0;
    int nP=19231, nF=38388;
};

